- /* sfodbdvf.cpp by K.Tsuru */
- // function ID = 727 DRADIX
- /***********************************************
- SFraction class
- It provides the division d/n, where d is double.
- d/(N/D) = (d*D)/N
- ************************************************/
- #ifndef SN_H
- #include "sn.h"
- #endif
- SFraction operator/(double d, const SFraction& n){
- if(n.Sign() == 0) n.num.SetError(n.num.DIVIDED_BY_ZERO,"double/SF", 711);
-
- SFraction r;
- if(d == 0.0) r.SetZero();
- else if(fabs(d) == 1.0L){
- r.Set(n.DenNR(), n.NumNR());
- if(d < 0.0) r.num.ChangeSign(); //r = -r;
- r.reduceDone = n.reduceDone;
- }else r.Set(d*n.DenNR(), n.NumNR()); // includes r.reduce(0);
- return r;
- }
sfodbdvf.cpp : last modifiled at 2016/04/22 11:25:53(680 bytes)
created at 2015/12/22 16:07:29
The creation time of this html file is 2016/09/13 19:56:38 (Tue Sep 13 19:56:38 2016).